package objects;

import java.io.Serializable;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;

/**
 * Created with IntelliJ IDEA.
 * User: Exceed^
 * Date: 19-04-12
 * Time: 11:52
 * To change this template use File | Settings | File Templates.
 */
@Named
@ApplicationScoped
public class Post implements Serializable{
    private User user;
    private String text;
    private Thread thread;
    private int rating;
    
    public Post(User user, String text, Thread thread)
    {
    	this.user = user;
    	this.text = text;
    	this.thread = thread;
    	rating = 0;
    }
    
    public User getUser()
    {
    	return user;
    }
    
    public String getText()
    {
    	return text;
    }
    public void setText(String text)
    {
    	this.text = text;
    }
    
    public Thread getThread()
    {
    	return thread;
    }
    
    public int getRating()
    {
    	return rating;
    }
    
    public void addRating(int value)
    {
    	rating += value;
    }
    public void subtractRating(int value)
    {
    	rating -= value;
    }
    public void resetRating()
    {
    	rating = 0;
    }
    
    public void save()
    {
    	//Do smth here.
    }
}
